import { Router } from '@angular/router';
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { SettingsService } from '@core/services/settings.service';
import { NzMessageService } from 'ng-zorro-antd';
import { ModalHelper } from '@shared/helper/modal.helper';
import { _HttpClient } from '@core/services/http.client';
// 服务
import { DataexpendService } from './dataexpand.service';
@Component({
    selector: 'app-dataexpand',
    // styleUrls: ['login.css'],
    providers: [DataexpendService],
    templateUrl: './dataexpand.component.html'
})
export class DataComponent implements OnInit {
    valForm: FormGroup;
    list: any[] = [];
    Page = 1;
    PageSize = 10;
    PkgType = '60';
    total = 0;
    isNull = 0;
    constructor(public settings: SettingsService, fb: FormBuilder, private router: Router, public http: _HttpClient,
        public msgSrv: NzMessageService, public dataexpendService: DataexpendService,
        private modalHelper: ModalHelper) {

    }
    ngOnInit() {
        this.load();
    }

    load(reload: boolean = false) {
        this.dataexpendService.queryListPage(this.Page, this.PageSize, this.PkgType).then(
            res => {
                console.log(res);
                if (res.data && res.data.length > 0) {
                    this.isNull = 0;
                    this.list = res.data;
                    this.total = res.total;
                } else {
                    this.list.length = 0;
                    this.isNull = 1;
                }
            }
        );
    }
    refresh() {
        this.load();
    }
    submit() {

    }
    // tslint:disable-next-line:eofline
}